﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace Web
{
    public class SessionHelp
    {

        /// <summary>
        /// 保证已登录，否则重定向到登录页面
        /// </summary>
        /// <param name="page"></param>
        public static void AssertLogin(System.Web.UI.Page page)
        {
            return;
        }
        /// <summary>
        /// 退出
        /// </summary>
        /// <param name="page"></param>
        public static void LogOut(System.Web.UI.Page page)
        {
            page.Session.Clear();
            page.Response.Cookies["LoginUser"].Expires = DateTime.Now.AddDays(-1);
            page.Response.Write("<script language='javascript'>top.location.href='/Default.aspx';</script>");
            page.Response.End();
        }
 
    }
}
